package cn.edu.flink.scala.tutorial.source

import org.apache.flink.streaming.api.scala._

object FromLocalTest {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI()
    env.setParallelism(1)

    // 直接输入元素
    val ints = env.fromElements(1, 2, 3)

    val events1 = env.fromElements(Event("kang", "home/", 10000L), Event("kang", "my/", 20000L))

    // 输入元素集合
    val events = List(Event("kang", "home/", 10000L), Event("kang", "my/", 20000L))
    val events2 = env.fromCollection(events)

    ints.print("ints")
    events1.print("events1")
    events2.print("events2")

    env.execute("FromLocal")
  }
}

